package com.job.createType.builder;

/**
 * @Author 王博
 * @DateTime 2025-04-28 08:23
 */
public class Director {
    private final Builder builder;
    public Director(Builder builder) {
        this.builder = builder;
    }

    /**
     * 装配过程
     */
    public Car construct(){
        this.builder.buildPower();
        this.builder.buildEngine();
        this.builder.buildBrand();
        return this.builder.createCar();
    }

    public static void main(String[] args) {
        Builder bydBuilder = new BydBuilder();
        Director director = new Director(bydBuilder);
        Car car = director.construct();
        System.out.println(car);
    }
}
